package com.zeh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zeh.pojo.Comment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentMapper extends BaseMapper<Comment> {

    //查询父级评论
    List<Comment> findByBlogIdParentIdNull(@Param("blogId") Long  blogId, @Param("blogParentId") Long blogParentId);

    //查询一级回复
    List<Comment> findByBlogParentIdNotNull(@Param("blogId")Long blogId,@Param("id") Long id);

    //查询二级回复
    List<Comment>findByBlogIdAndReplayId(@Param("blogId")Long blogId,@Param("childId") Long childId);

    //添加一个评论
    int saveComment(Comment comment);

//    //删除评论
//    void deleteComment(Long id);


}
